package com.fw.util;

public class DataUtils {

    public static final boolean isChange(Object object1, Object object2) {
	boolean isChange = false;
	if (object1 == null && object2 != null) {
	    isChange = true;
	} else if (object1 == null && object2 == null) {
	    isChange = false;
	} else if (object1 != null && object2 == null) {
	    isChange = true;
	} else if (object1 != null && object2 != null) {
	    if (!object1.equals(object2)) {
		isChange = true;
	    } else {
		isChange = false;
	    }
	}
	return isChange;
    }

    public static final String stringValue(Object object) {
	String stringValue = null;
	if (object == null) {
	    stringValue = "";
	} else if (object instanceof Boolean) {
	    Boolean booleanObj = (Boolean) object;
	    stringValue = booleanObj.toString();
	} else {
	    stringValue = object.toString();
	}
	return stringValue;
    }
}
